home *** CD-ROM | disk | FTP | other *** search
- /*
- File: menus.c
-
- Copyright: © 1997-1998 by Apple Computer, Inc., all rights reserved.
-
- */
-
- #pragma segment AppSeg
-
- #ifndef __SCRAP__
- #include <Scrap.h>
- #endif
-
- #ifndef __DEVICES__
- #include <Devices.h>
- #endif
-
- #ifndef __TOOLUTILS__
- #include <ToolUtils.h>
- #endif
-
-
- #ifndef Common_Defs
- #include "Common.h"
- #endif
-
- extern Document* gDocumentList[kMaxDocumentCount];
- extern short gDocumentCount;
- extern short gCanUndoDrag;
- extern short gQuit, gQuitting;
- extern Boolean gNavServicesExists;
-
- // prototypes:
- void SetItemEnable( MenuHandle theMenu, short theItem, short enable );
- short DoPaste( );
- void DoAbout( );
- void DoSelectDictionary( );
- void DoSelectDirectory( );
- void DoSelectObject( );
- void DoSelectVolume( );
- void DoCreateFolder( );
- void DoCustomOpen( );
-
- // for customization:
- pascal void myCustomEventProc( NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD);
- void HandleCustomMouseDown( NavCBRecPtr callBackParms );
- void HandleCommandPopup( ControlHandle thePopup, NavCBRecPtr callBackParms );
-
-
- // custom dialog item:
- #define kControlListID 132
- #define kPopupCommand 1
-
- // the requested dimensions for our customization area:
- #define kCustomWidth 100
- #define kCustomHeight 40
-
- // customization globals:
- Handle gDitlList;
- MenuHandle gPopupMenu;
- short gLastTryWidth;
- short gLastTryHeight;
-
-
- // *****************************************************************************
- // *
- // * SetItemEnable()
- // *
- // *****************************************************************************
- void SetItemEnable(MenuHandle theMenu, short theItem, short enable)
- {
- if (enable)
- EnableItem(theMenu,theItem);
- else
- DisableItem(theMenu,theItem);
- }
-
-
- // *****************************************************************************
- // *
- // * AdjustMenus()
- // *
- // *****************************************************************************
- void AdjustMenus()
- {
- MenuHandle theMenu;
- Document* theDocument;
- short teSelection = 0;
- Str255 theStr;
-
- theDocument = IsDocumentWindow((WindowPtr)FrontWindow());
-
- if (theDocument->theTE != NULL)
- teSelection = (theDocument) && ((**(theDocument->theTE)).selStart != (**(theDocument->theTE)).selEnd);
-
- theMenu = GetMenuHandle(idFileMenu);
-
- SetItemEnable(theMenu,NewItem,gDocumentCount < kMaxDocumentCount);
- SetItemEnable(theMenu,OpenItem,gDocumentCount < kMaxDocumentCount);
-
- SetItemEnable(theMenu,CloseItem,theDocument != 0L);
- SetItemEnable(theMenu,SaveItem,(theDocument) && (theDocument->dirty));
- SetItemEnable(theMenu,RevertItem,(theDocument) && (theDocument->dirty) && (theDocument->fRefNum));
- SetItemEnable(theMenu,SaveACopyItem,theDocument != 0L);
- SetItemEnable(theMenu,DictionaryItem,gNavServicesExists);
-
- theMenu = GetMenuHandle(idEditMenu);
-
- GetIndString(theStr,MenuStringsID,gCanUndoDrag);
- SetMenuItemText(theMenu,iUndo,theStr);
- SetItemEnable(theMenu,iUndo,gCanUndoDrag != slCantUndo);
-
- SetItemEnable(theMenu,iCut,teSelection);
- SetItemEnable(theMenu,iCopy,teSelection);
- SetItemEnable(theMenu,iPaste,theDocument != 0L);
- SetItemEnable(theMenu,iClear,teSelection);
- SetItemEnable(theMenu,iSelectAll,theDocument != 0L);
-
- theMenu = GetMenuHandle(idUtilsMenu);
- SetItemEnable(theMenu,iSelectDir,gNavServicesExists);
- SetItemEnable(theMenu,iSelectVol,gNavServicesExists);
- SetItemEnable(theMenu,iSelectObject,gNavServicesExists);
- SetItemEnable(theMenu,iCreateFolder,gNavServicesExists);
- SetItemEnable(theMenu,iCustomOpen,gNavServicesExists);
- }
-
-
- // *****************************************************************************
- // *
- // * DoPaste()
- // *
- // *****************************************************************************
- short DoPaste()
- {
- long size, offset;
- Handle theData;
-
- size = GetScrap(0L,'UPRC',&offset);
-
- if (size <= 0)
- return(0);
-
- theData = NewHandle(size);
- GetScrap(theData,'UPRC',&offset);
-
- HLock(theData);
- PutScrap(size,'test',*theData);
-
- HUnlock(theData);
- DisposeHandle(theData);
-
- return noErr;
- }
-
-
- // *****************************************************************************
- // *
- // * DoSelectDictionary()
- // *
- // *****************************************************************************
- void DoSelectDictionary()
- {
- NavReplyRecord theReply;
- NavDialogOptions dialogOptions;
- OSErr theErr = noErr;
- NavEventUPP eventUPP = NewNavEventProc(myEventProc);
- NavTypeListHandle openList = NULL;
-
- // use the default location for the dialog:
- theErr = NavGetDefaultDialogOptions(&dialogOptions);
-
- GetIndString(dialogOptions.message,rAppStringsID,sChooseFile);
-
- dialogOptions.preferenceKey = kSelectFilePrefKey;
-
- openList = (NavTypeListHandle)GetResource(kOpenRsrcType,kOpenRsrcID2);
-
- theErr = NavChooseFile( NULL,
- &theReply,
- &dialogOptions,
- eventUPP,
- NULL,
- NULL,
- openList,
- (NavCallBackUserData)&gDocumentList);
-
- DisposeRoutineDescriptor(eventUPP);
-
- if ((theReply.validRecord)&&(theErr == noErr))
- {
- // grab the target FSSpec from the AEDesc:
- FSSpec finalFSSpec;
- AEDesc resultDesc;
-
- theErr = AECoerceDesc(&(theReply.selection),typeFSS,&resultDesc);
- if (theErr == noErr)
- {
- BlockMove(*resultDesc.dataHandle,(void*)&finalFSSpec,sizeof(FSSpec));
- // 'finalFSSpec' is the chosen file…
- }
-
- theErr = NavDisposeReply(&theReply);
- }
-
- if (openList != NULL)
- DisposeHandle((Handle)openList);
- }
-
-
- // *****************************************************************************
- // *
- // * DoSelectDirectory()
- // *
- // *****************************************************************************
- void DoSelectDirectory()
- {
- NavReplyRecord theReply;
- NavDialogOptions dialogOptions;
- OSErr theErr = noErr;
- NavEventUPP eventUPP = NewNavEventProc(myEventProc);
-
- theErr = NavGetDefaultDialogOptions(&dialogOptions);
-
- GetIndString(dialogOptions.message,rAppStringsID,sChooseFolder);
-
- dialogOptions.preferenceKey = kSelectFolderPrefKey;
-
- theErr = NavChooseFolder( NULL,
- &theReply,
- &dialogOptions,
- eventUPP,
- NULL,
- (NavCallBackUserData)&gDocumentList);
-
- DisposeRoutineDescriptor(eventUPP);
-
- if ((theReply.validRecord)&&(theErr == noErr))
- {
- // grab the target FSSpec from the AEDesc:
- FSSpec finalFSSpec;
- AEDesc resultDesc;
-
- theErr = AECoerceDesc(&(theReply.selection),typeFSS,&resultDesc);
- if (theErr == noErr)
- {
- BlockMove(*resultDesc.dataHandle,(void*)&finalFSSpec,sizeof(FSSpec));
- // 'finalFSSpec' is the selected directory…
- }
-
- theErr = NavDisposeReply(&theReply);
- }
- }
-
-
- // *****************************************************************************
- // *
- // * DoSelectObject()
- // *
- // *****************************************************************************
- void DoSelectObject()
- {
- NavReplyRecord theReply;
- NavDialogOptions dialogOptions;
- OSErr theErr = noErr;
- NavEventUPP eventUPP = NewNavEventProc(myEventProc);
-
- theErr = NavGetDefaultDialogOptions(&dialogOptions);
-
- GetIndString(dialogOptions.message,rAppStringsID,sChooseObject);
-
- dialogOptions.preferenceKey = kSelectObjectPrefKey;
-
- theErr = NavChooseObject( NULL,
- &theReply,
- &dialogOptions,
- eventUPP,
- NULL,
- (NavCallBackUserData)&gDocumentList);
-
- DisposeRoutineDescriptor(eventUPP);
-
- if ((theReply.validRecord)&&(theErr == noErr))
- {
- // grab the target FSSpec from the AEDesc:
- FSSpec finalFSSpec;
- AEDesc resultDesc;
-
- theErr = AECoerceDesc(&(theReply.selection),typeFSS,&resultDesc);
- if (theErr == noErr)
- {
- BlockMove(*resultDesc.dataHandle,(void*)&finalFSSpec,sizeof(FSSpec));
- // 'finalFSSpec' is the selected directory…
- }
-
- theErr = NavDisposeReply(&theReply);
- }
- }
-
-
-
- // *****************************************************************************
- // *
- // * DoSelectVolume()
- // *
- // *****************************************************************************
- void DoSelectVolume()
- {
- NavReplyRecord theReply;
- NavDialogOptions dialogOptions;
- OSErr theErr = noErr;
- NavEventUPP eventUPP = NewNavEventProc(myEventProc);
-
- // use the default location for the dialog:
- theErr = NavGetDefaultDialogOptions(&dialogOptions);
-
- GetIndString(dialogOptions.message,rAppStringsID,sChooseVolume);
-
- dialogOptions.preferenceKey = kSelectVolumePrefKey;
-
- theErr = NavChooseVolume( NULL,
- &theReply,
- &dialogOptions,
- eventUPP,
- NULL,
- (NavCallBackUserData)&gDocumentList);
- if ((theReply.validRecord)&&(theErr == noErr))
- {
- // grab the target FSSpec from the AEDesc:
- FSSpec finalFSSpec;
- AEDesc resultDesc;
-
- // there is only one selection here we get only the first AEDesc:
- theErr = AECoerceDesc(&(theReply.selection),typeFSS,&resultDesc);
- if (theErr == noErr)
- {
- BlockMove(*resultDesc.dataHandle,(void*)&finalFSSpec,sizeof(FSSpec));
- // 'finalFSSpec' is the chosen volume…
- }
-
- theErr = NavDisposeReply(&theReply);
- }
-
- DisposeRoutineDescriptor(eventUPP);
- }
-
-
- // *****************************************************************************
- // *
- // * DoCreateFolder()
- // *
- // *****************************************************************************
- void DoCreateFolder()
- {
- NavReplyRecord theReply;
- NavDialogOptions dialogOptions;
- OSErr theErr = noErr;
- NavEventUPP eventUPP = NewNavEventProc(myEventProc);
-
- // use the default location for the dialog:
- theErr = NavGetDefaultDialogOptions(&dialogOptions);
-
- GetIndString(dialogOptions.message,rAppStringsID,sCreateFolder);
-
- dialogOptions.preferenceKey = kNewFolderPrefKey;
-
- theErr = NavNewFolder( NULL,
- &theReply,
- &dialogOptions,
- eventUPP,
- (NavCallBackUserData)&gDocumentList);
- if (theReply.validRecord)
- {
- // grab the target FSSpec from the AEDesc:
- FSSpec finalFSSpec;
- AEDesc resultDesc;
-
- // there is only one selection here so we get the first AEDesc:
- theErr = AECoerceDesc(&(theReply.selection),typeFSS,&resultDesc);
- if (theErr == noErr)
- {
- BlockMove(*resultDesc.dataHandle,(void*)&finalFSSpec,sizeof(FSSpec));
- // 'finalFSSpec' is the newly created folder…
- }
-
- theErr = NavDisposeReply(&theReply);
- }
- }
-
-
- // *****************************************************************************
- // *
- // * HandleCommandPopup()
- // *
- // *****************************************************************************
- void HandleCommandPopup(ControlHandle thePopup, NavCBRecPtr callBackParms)
- {
- OSErr theErr = noErr;
- short selection = 0;
-
- selection = GetControlValue(thePopup)-1;
- switch (selection)
- {
- case kNavCtlShowDesktop:
- case kNavCtlScrollHome:
- case kNavCtlScrollEnd:
- case kNavCtlPageUp:
- case kNavCtlPageDown:
- theErr = NavCustomControl(callBackParms->context,selection,NULL);
- break;
-
- case kNavCtlShowSelection:
- theErr = NavCustomControl(callBackParms->context,kNavCtlShowSelection,NULL);
- break;
-
- case kNavCtlOpenSelection:
- {
- AEDesc itemToOpen;
- theErr = NavCustomControl(callBackParms->context,kNavCtlOpenSelection,&itemToOpen);
- if (itemToOpen.descriptorType == typeFSS)
- {
- // you may open the file as described by 'itemToOpen', or do whatever you want with it:
- AEDisposeDesc(&itemToOpen);
- }
- break;
- }
-
- case kNavCtlCancel:
- theErr = NavCustomControl(callBackParms->context,kNavCtlCancel,NULL);
- break;
-
- case kNavCtlAccept:
- theErr = NavCustomControl(callBackParms->context,kNavCtlAccept,NULL);
- break;
- }
- }
-
-
- void HandleCustomMouseDown(NavCBRecPtr callBackParms)
- {
- OSErr theErr = noErr;
- ControlHandle whichControl;
- Point where = callBackParms->eventData.event->where;
- short theItem = 0;
- UInt16 firstItem = 0;
- short realItem = 0;
- short partCode = 0;
-
- GlobalToLocal(&where);
- theItem = FindDialogItem(callBackParms->window,where); // get the item number of the control
- partCode = FindControl(where,callBackParms->window,&whichControl); // get the control itself
-
- // ask NavServices for the first custom control's ID:
- if (callBackParms->context != 0) // always check to see if the context is correct
- {
- theErr = NavCustomControl(callBackParms->context,kNavCtlGetFirstControlID,&firstItem);
- realItem = theItem - firstItem + 1; // map it to our DITL constants:
- }
-
- if (realItem == kPopupCommand)
- HandleCommandPopup(whichControl,callBackParms);
- }
-
-
- // *****************************************************************************
- // *
- // * myEventProc()
- // *
- // *****************************************************************************
- pascal void myCustomEventProc( NavEventCallbackMessage callBackSelector,
- NavCBRecPtr callBackParms,
- NavCallBackUserData callBackUD)
- {
- OSErr theErr = noErr;
- WindowPtr pWindow = NULL;
- Document** docList;
- Document* theDoc = NULL;
- short index = 0;
-
- if (callBackUD != 0)
- switch (callBackSelector)
- {
- case kNavCBEvent:
- {
- docList = (Document**)callBackUD;
- if (docList != NULL)
- switch (callBackParms->eventData.event->what)
- {
- case mouseDown:
- HandleCustomMouseDown(callBackParms);
- break;
-
- case updateEvt:
- pWindow = (WindowPtr)callBackParms->eventData.event->message;
- theDoc = docList[index];
- if (theDoc != NULL)
- {
- while ((theDoc->theWindow != pWindow) && (docList[index] != NULL))
- {
- index++;
- theDoc = docList[index];
- }
- theDoc = docList[index];
- if (theDoc != NULL)
- UpdateWindow(theDoc);
- }
- break;
-
- default:
- break;
- }
- break;
- }
-
- case kNavCBCustomize:
- {
- // here are the desired dimensions for our custom area:
- short neededWidth = callBackParms->customRect.left + kCustomWidth;
- short neededHeight = callBackParms->customRect.top + kCustomHeight;
-
- // check to see if this is the first round of negotiations:
- if ((callBackParms->customRect.right == 0) && (callBackParms->customRect.bottom == 0))
- {
- // it is, so tell NavServices what dimensions we want:
- callBackParms->customRect.right = neededWidth;
- callBackParms->customRect.bottom = neededHeight;
- }
- else
- {
- // we are in the middle of negotiating:
- if (gLastTryWidth != callBackParms->customRect.right)
- if (callBackParms->customRect.right < neededWidth) // is NavServices width too small for us?
- callBackParms->customRect.right = neededWidth;
-
- if (gLastTryHeight != callBackParms->customRect.bottom) // is NavServices height too small for us?
- if (callBackParms->customRect.bottom < neededHeight)
- callBackParms->customRect.bottom = neededHeight;
- }
-
- // remember our last size so the next time we can re-negotiate:
- gLastTryWidth = callBackParms->customRect.right;
- gLastTryHeight = callBackParms->customRect.bottom;
- break;
- }
-
- case kNavCBStart:
- {
- short itemType;
- Rect itemRect;
- Handle itemH;
- UInt16 firstItem = 0;
- short realItem = 0;
-
- // add the rest of the custom controls via the DITL resource list:
- gDitlList = GetResource('DITL',kControlListID);
- if ((gDitlList != NULL)&&(ResError() == noErr))
- if ((theErr = NavCustomControl(callBackParms->context,kNavCtlAddControlList,gDitlList)) == noErr)
- {
- theErr = NavCustomControl(callBackParms->context,kNavCtlGetFirstControlID,&firstItem); // ask NavServices for our first control ID
-
- // set the command popup selection:
- realItem = firstItem + kPopupCommand;
- GetDialogItem(callBackParms->window,realItem,&itemType,&itemH,&itemRect);
- SetControlValue((ControlHandle)itemH,1);
- }
-
- // the dialog is starting up, let's override the default popup menu selection:
- UInt16 itemToSelect = kNavAllReadableFiles;
- theErr = NavCustomControl(callBackParms->context,kNavCtlSelectAllType,&itemToSelect);
- break;
- }
-
- case kNavCBTerminate:
- // release our appended popup menu:
- if (gDitlList)
- ReleaseResource(gDitlList);
- if (gPopupMenu)
- DisposeMenu(gPopupMenu);
- break;
- }
- }
-
-
- // *****************************************************************************
- // *
- // * DoCustomOpen()
- // *
- // *****************************************************************************
- void DoCustomOpen()
- {
- NavReplyRecord theReply;
- NavDialogOptions dialogOptions;
- OSErr theErr = noErr;
- NavTypeListHandle typeList = NULL;
- long count = 0;
- NavEventUPP eventUPP = NewNavEventProc(myCustomEventProc);
-
- // default behavior for browser and dialog:
- theErr = NavGetDefaultDialogOptions(&dialogOptions);
-
- GetIndString((unsigned char*)&dialogOptions.clientName,rAppStringsID,sApplicationName);
-
- typeList = (NavTypeListHandle)GetResource(kOpenRsrcType,kOpenRsrcID);
-
- theErr = NavGetFile(NULL, // use system's default location
- &theReply,
- &dialogOptions,
- eventUPP,
- NULL, // no custom previews
- NULL,
- typeList,
- (NavCallBackUserData)&gDocumentList);
-
- DisposeRoutineDescriptor(eventUPP);
-
- if (theReply.validRecord && theErr == noErr)
- {
- // since we allow for multiple objects to be returned,
- // grab the target FSSpecs from 'theReply.fileRef' list for opening:
- FSSpec finalFSSpec;
- AEDesc resultDesc;
- FInfo fileInfo;
-
- // we are ready to open the document(s), grab information about each file for opening:
- theErr = AECountItems(&(theReply.selection),&count);
- for (long index=1;index<=count;index++)
- {
- resultDesc.dataHandle = 0L;
- theErr = AEGetNthDesc(&(theReply.selection),index,typeFSS,NULL,&resultDesc);
- if (theErr == noErr)
- {
- BlockMoveData(*resultDesc.dataHandle,&finalFSSpec,sizeof(FSSpec));
-
- // decide if the doc we are opening is a 'PICT' or 'TEXT':
- theErr = FSpGetFInfo(&finalFSSpec,&fileInfo);
- if (theErr == noErr)
- {
- if (fileInfo.fdType == kFileType)
- (void)DoOpenFile(&finalFSSpec,false);
- else
- if (fileInfo.fdType == kFileTypePICT)
- (void)DoOpenFile(&finalFSSpec,true);
- else
- {
- // error:
- // if we got this far, the document is a type we can't open and
- // (most likely) built-in translation was turned off.
- // You can alert the user that this returned selection or file spec
- // needs translation.
- }
- }
- theErr = AEDisposeDesc(&resultDesc);
- }
- }
-
- theErr = NavDisposeReply(&theReply); // clean up after ourselves
- }
-
- if (typeList != NULL)
- ReleaseResource((Handle)typeList);
- }
-
-
- // *****************************************************************************
- // *
- // * DoAbout()
- // *
- // *****************************************************************************
- void DoAbout()
- {
- GrafPtr savePort;
- DialogPtr aboutDialog;
- short itemHit = 0;
- Handle itemH;
- short itemType;
- Rect itemRect;
-
- SetCursor(&qd.arrow);
- aboutDialog = GetNewDialog(rAboutID,nil,(WindowRef)-1);
-
- GetPort(&savePort);
-
- SetPort((GrafPtr)aboutDialog);
-
- AdornButton(aboutDialog,dOK);
-
- GetDialogItem(aboutDialog,iIconSuite,&itemType,&itemH,&itemRect);
- DrawIconSuite(rIconSuite,itemRect);
-
- do ModalDialog(nil,&itemHit);
-
- while(itemHit != dOK);
-
- SetPort(savePort);
- DisposeDialog(aboutDialog);
- }
-
-
- // *****************************************************************************
- // *
- // * DoMenuCommand()
- // *
- // *****************************************************************************
- void DoMenuCommand(long select)
- {
- short theMenuID, theItem;
- MenuHandle theMenu;
- Str255 theName;
- WindowPtr theWindow;
- Document* theDocument = nil;
- OSStatus theErr = noErr;
-
- gCanUndoDrag = slUndoDrag;
- AdjustMenus();
-
- theDocument = IsDocumentWindow(theWindow = (WindowPtr)FrontWindow());
-
- theItem = LoWord(select);
- theMenuID = HiWord(select);
- theMenu = GetMenuHandle(theMenuID);
- switch(theMenuID)
- {
- case idAppleMenu:
- switch(theItem)
- {
- case AboutItem:
- DoAbout();
- break;
- default:
- GetMenuItemText(GetMenuHandle(idAppleMenu),theItem,(unsigned char*)&theName);
- OpenDeskAcc(theName);
- }
- break;
-
- case idFileMenu:
- switch(theItem)
- {
- case NewItem:
- DoNewDocument(false);
- AdjustMenus();
- break;
-
- case OpenItem:
- if (gNavServicesExists)
- (void)DoOpenDocument();
- else
- (void)DoOpenDocumentTheOldWay();
- AdjustMenus();
- break;
-
- case CloseItem:
- if (theDocument)
- {
- CloseDocument(theDocument,false);
- AdjustMenus();
- DrawMenuBar();
- }
- break;
-
- case SaveItem:
- if (theDocument)
- DoSaveDocument(theDocument);
- break;
-
- case SaveACopyItem:
- if (theDocument)
- {
- if (gNavServicesExists)
- (void)SaveACopyDocument(theDocument);
- else
- (void)SaveACopyDocumentTheOldWay(theDocument);
- }
- break;
-
- case RevertItem:
- DisableUndoDrag();
- if (theDocument)
- {
- if (gNavServicesExists)
- DoRevertDocument(theDocument);
- else
- DoRevertDocumentTheOldWay(theDocument);
- }
- break;
-
- case DictionaryItem:
- DoSelectDictionary();
- break;
-
- case QuitItem:
- gQuitting = true;
- while ((gQuitting) && (theDocument = IsDocumentWindow((WindowPtr)FrontWindow())))
- CloseDocument(theDocument,true);
- if (gQuitting)
- gQuit = true;
- break;
- }
- break;
-
- case idEditMenu:
- switch(theItem)
- {
- case iUndo:
- DoUndoDrag();
- break;
-
- case iCut:
- if ((theDocument)&&(theDocument->theTE != NULL))
- {
- DisableUndoDrag();
- myTECut(theDocument->theTE);
- }
- break;
-
- case iCopy:
- if (theDocument)
- TECopy(theDocument->theTE);
- break;
-
- case iPaste:
- if ((theDocument)&&(theDocument->theTE != NULL))
- if (!DoPaste())
- {
- DisableUndoDrag();
- myTEPaste(theDocument->theTE,0L,0L);
- }
- break;
-
- case iClear:
- if ((theDocument)&&(theDocument->theTE != NULL))
- {
- DisableUndoDrag();
- TEDelete(theDocument->theTE);
- }
- break;
-
- case iSelectAll:
- if ((theDocument)&&(theDocument->theTE != NULL))
- DoSelectAllDocument(theDocument);
- break;
- }
- break;
-
- case idUtilsMenu:
- switch (theItem)
- {
- case iSelectDir:
- DoSelectDirectory();
- break;
- case iSelectVol:
- DoSelectVolume();
- break;
- case iSelectObject:
- DoSelectObject();
- break;
- case iCreateFolder:
- DoCreateFolder();
- break;
- case iCustomOpen:
- DoCustomOpen();
- break;
- }
- break;
- }
-
- if (theDocument = IsDocumentWindow((WindowPtr)FrontWindow()))
- if (theDocument->theTE != NULL)
- TEGetHiliteRgn(theDocument->hiliteRgn,theDocument->theTE);
-
- HiliteMenu(0);
-
- gCanUndoDrag = slCantUndo;
- }
-
-